<?php
//init.php
//by QINIAO

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ob_start();

define('QINIAO_ROOT', dirname(__FILE__));
require_once(QINIAO_ROOT.'/xingTemplate/xingTemplate.php');
$xingTemplate->setConfig('PHP_off',true);

require_once(QINIAO_ROOT.'/config.inc.php');
require_once(QINIAO_ROOT.'/inc/function.base.php');
require_once(QINIAO_ROOT.'/model/class.mysql.php');
require_once(QINIAO_ROOT.'/model/class.cache.php');

header('Content-Type: text/html; charset=UTF-8');

$DB = new MySql(DB_HOST,DB_USER,DB_PASSWD,DB_NAME);
$CACHE = new qiCache($DB,DB_PREFIX);

//$CACHE->qc_options();

$options_cache = $CACHE->cacheRead('options');
extract($options_cache);

$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';
$ts = isset($_GET['ts']) ? addslashes($_GET['ts']) : '';

//cookie判断是否登陆并通过用户名获取用户信息
$username =isset( $_COOKIE['username']) ? $_COOKIE['username'] : '';
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : '';
$cookieresult = $DB->query("select * from ".DB_PREFIX."users where username='$username' and password='$password'");
$cookienum = $DB->num_rows($cookieresult);
if(!empty($cookienum))
{
$user = $DB->fetch_array($cookieresult);
$uid=$user['id'];
$tname=$user['truename'];
$admin=$user['isadmin'];
}

//全局广告
require_once('model/class.ads.php');
$qiAds = new qiAds($DB);

//获取网站基本信息
/* require_once('model/class.option.php');
$qiOption = new qiOption($DB);
$qi_option = $qiOption->getOption(); */

//程序版本号
$version="时尚起义V.0.2";              

//程序官网
$versionurl="http://www.77661.cn/";    

//换算中国时区
date_default_timezone_set('Etc/GMT-8');

?>